package test;
import java.awt.EventQueue;



import jade.core.*;

/*
 * ***********************Jade运行参数配置******************************
 *
 * Main:		jade.Boot
 * Arguments:	-gui name:package.class_name;
 * 				[其中name为自定义Agent名,pakage.class_name指代类的路径]
 * 
 * *************************基本Agent实现及原理****************************
 * 1.类的定义
 * import jade.core.*;
 * 
 * public class new_agent extends Agent(){
 * 		@override
 * 		public void setup(){
 * 
 * 		//.....................
 * 
 * 		}
 * }
 * 2. 使用Container运行
 * 		java jade.Boot -gui name:package.class_name;
 * 
 * ************************************************************************
 */
public class HelloWorldAgent extends Agent{

	   public void setup(){
        System.out.println("Agent Started: Hello World!");
	        System.out.println("-----About Me:-----");
	        System.out.println("My local name is:"+getLocalName());
	        //getLocalName()返回Agent名name,这个名在
	        System.out.println("My globally unique name is:"+getName() );
	        //getName()返回"name@ip/JADE"
	        System.out.println("-----About Here:-----");
	        Location l = here();//Agent运行的Container地址Location类
	        System.out.println("I am running in a location called:"+l.getName());
	        //Location.getName()返回Container_name
	        System.out.println("Which is identified uniquely as:"+l.getID());
	        //Location.getID()返回ContainerID:"Container_name@IP"
	        System.out.println("And is contactable at:"+l.getAddress());
	        //Location.getAddress()返回Container的IP地址
	        System.out.println("Using the protocol:"+l.getProtocol());
	        //Location.getProtocol()返回Container的协议s
	   		}
	   }